<template>
  <a-config-provider :locale="zhCN" :autoInsertSpaceInButton="false">
    <a-spin :spinning="spinning" tip="稍等片刻，拼命加载中..." size="large">
      <div class="acc-view zz-ant-dark"><router-view /></div>
    </a-spin>
  </a-config-provider>
</template>

<script setup>
  import { onMounted, computed } from 'vue';
  import zhCN from 'ant-design-vue/es/locale/zh_CN';
  import { useSpinStore } from './store';
  // import {fetchLoginInfo} from './server/auth';
  
  // 全局loading
  const spinStore = useSpinStore();
  const spinning = computed(() => spinStore.loading);
  
  onMounted(()=>{
    // spinStore.show();
    // fetchLoginInfo().finally(()=>{
    //   // spinStore.hide()
    // });
  })
  
</script>

<style lang="less">

#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  // text-align: center;
  color: #2c3e50;
}

.acc-view {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;

  display: flex;
  align-items: center;
  justify-content: center;
  // background-color: #2d3a4b;
}

/* 进度条加载自定义颜色 */
#nprogress .bar {
  background: red !important;
}

.ant-spin-nested-loading >div>.ant-spin {
  max-height: unset; 
  height: 100vh;
}
</style>